home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form Form1
- BorderStyle = 3 'Fixed Double
- Caption = "WallPeeper"
- ClientHeight = 3960
- ClientLeft = 105
- ClientTop = 690
- ClientWidth = 4455
- FillColor = &H00010000&
- ForeColor = &H00808080&
- Height = 4650
- Icon = WALLPEEP.FRX:0000
- Left = 45
- LinkMode = 1 'Source
- LinkTopic = "Form1"
- MaxButton = 0 'False
- ScaleHeight = 264
- ScaleMode = 3 'Pixel
- ScaleWidth = 297
- Top = 60
- Width = 4575
- Begin CheckBox ShowAllFiles
- Caption = "Show all usable files on C"
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 8.25
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 255
- Left = 75
- TabIndex = 13
- Top = 2910
- Width = 2175
- End
- Begin CheckBox TileChecked
- Caption = "Tile"
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 8.25
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 255
- Left = 75
- TabIndex = 12
- Top = 3630
- Value = 1 'Checked
- Width = 735
- End
- Begin PictureBox Picture2
- AutoRedraw = -1 'True
- AutoSize = -1 'True
- Height = 450
- Left = 1440
- ScaleHeight = 28
- ScaleMode = 3 'Pixel
- ScaleWidth = 33
- TabIndex = 11
- Top = 4200
- Width = 525
- End
- Begin CheckBox ResizableChecked
- Caption = "Resizable"
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 8.25
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 240
- Left = 2400
- TabIndex = 10
- Top = 4320
- Value = 1 'Checked
- Width = 1485
- End
- Begin Timer Timer1
- Left = 930
- Top = 5925
- End
- Begin PictureBox Picture1
- AutoRedraw = -1 'True
- AutoSize = -1 'True
- BorderStyle = 0 'None
- Height = 450
- Left = 240
- ScaleHeight = 30
- ScaleMode = 3 'Pixel
- ScaleWidth = 35
- TabIndex = 4
- Top = 4200
- Width = 525
- End
- Begin FileListBox File2
- Height = 810
- Left = 2475
- Pattern = "*.bmp;*.ico;*.wmf;*.rle;*.dib"
- TabIndex = 7
- Top = 4755
- Width = 1845
- End
- Begin DirListBox Dir2
- Height = 900
- Left = 60
- TabIndex = 6
- Top = 4755
- Width = 2280
- End
- Begin CommandButton Command1
- Caption = "Set as Wallpaper"
- Default = -1 'True
- Height = 315
- Left = 75
- TabIndex = 9
- Top = 3240
- Width = 4275
- End
- Begin CommandButton Command2
- Caption = "Refresh List"
- Enabled = 0 'False
- Height = 315
- Left = 2430
- TabIndex = 3
- Top = 2880
- Visible = 0 'False
- Width = 1920
- End
- Begin DirListBox Dir1
- ForeColor = &H00000000&
- Height = 2280
- Left = 75
- TabIndex = 0
- Top = 555
- Width = 2295
- End
- Begin ListBox List1
- Enabled = 0 'False
- Height = 2760
- Left = 2445
- Sorted = -1 'True
- TabIndex = 5
- Top = 75
- Visible = 0 'False
- Width = 1905
- End
- Begin FileListBox File1
- Height = 2760
- Left = 2445
- Pattern = "*.bmp;*.ico;*.wmf;*.rle;*.dib"
- TabIndex = 1
- Top = 75
- Width = 1905
- End
- Begin DriveListBox Drive1
- Height = 315
- Left = 75
- TabIndex = 2
- Top = 75
- Width = 2295
- End
- Begin Label Label1
- Alignment = 1 'Right Justify
- Height = 240
- Left = 2970
- TabIndex = 8
- Top = 2940
- Visible = 0 'False
- Width = 1335
- End
- Begin Menu FileMenu
- Caption = "File"
- Begin Menu FileExit
- Caption = "E&xit"
- End
- Begin Menu FileSep
- Caption = "-"
- End
- Begin Menu FileAbout
- Caption = "&About WallPeeper..."
- End
- End
- DefInt A-Z
- Declare Function GetVersion Lib "Kernel" () As Long
- Declare Function GetWindowsDirectory Lib "kernel" (ByVal P$, ByVal S)
- Declare Sub SystemParametersInfo Lib "User" (ByVal wAction%, ByVal wParam%, lParam As Any, ByVal fWinIni%)
- Declare Function WriteProfileString% Lib "Kernel" (ByVal lpAppName$, ByVal lpKeyName$, ByVal lpString$)
- Const SPI_SETDESKWALLPAPER = 20
- Const SPIF_UPDATEINIFILE = 1 'update Win.ini Const
- Const SPIF_SENDWININICHANGE = 2 'update Win.ini and tell everyone
- Sub Command1_Click ()
- OldMouseP = Screen.MousePointer
- Screen.MousePointer = 11
- Dim WinPath As String
- BmpFile$ = "WALLPEEP.BMP"
- WinPath = String$(145, Chr$(0))
- T% = GetWindowsDirectory(WinPath, Len(WinPath))
- WinPath = Left$(WinPath, T%)
- Call DragPictureTo((Form2.DestinationPic.Width), (Form2.DestinationPic.Height), False)
- Form1.Picture2.Picture = Form2.DestinationPic.Image
- Call DottedLine
- Form1.Picture2.Width = Form2.DestinationPic.Width
- Form1.Picture2.Height = Form2.DestinationPic.Height
- Form1.Picture2.ScaleWidth = Form2.DestinationPic.ScaleWidth
- Form1.Picture2.ScaleHeight = Form2.DestinationPic.ScaleHeight
- SavePicture Form1.Picture2.Image, WinPath + "\" + BmpFile$
- '[Desktop]
- 'Pattern = (None)
- 'Wallpaper=C:\WINDOWS\WALLVIEW.BMP
- 'GridGranularity = 0
- 'IconSpacing = 93
- 'TileWallPaper = 1
- If Form1.TileChecked.Value = 0 Then
- T% = WriteProfileString%("Desktop", "TileWallPaper", "0")
- T% = WriteProfileString%("Desktop", "TileWallPaper", "1")
- End If
- SystemParametersInfo SPI_SETDESKWALLPAPER, 0, ByVal WinPath + "\" + BmpFile$, SPIF_UPDATEINIFILE
- Screen.MousePointer = OldMouseP
- End Sub
- Sub Command2_Click ()
- Command2.Enabled = False
- OldMousePointer = Screen.MousePointer
- Screen.MousePointer = 11
- Call FillList
- Screen.MousePointer = OldMousePointer
- End Sub
- Sub Dir1_Change ()
- File1.Path = Dir1.Path
- End Sub
- Sub Dir1_Click ()
- Dir1.Path = Dir1.List(Dir1.ListIndex)
- End Sub
- Sub Drive1_Change ()
- On Error Resume Next
- If SavedDrive$ = Drive1.Drive Then Exit Sub
- Dir1.Path = Drive1.Drive
- If Err <> 0 Then
- On Error Resume Next
- MsgBox "Error reading drive " + Drive1.Drive
- Drive1.Drive = SavedDrive$
- On Error Resume Next
- Dir1.Path = Drive1.Drive
- On Error GoTo 0
- Exit Sub
- End If
- On Error GoTo 0
- If (List1.ListCount > 0) And (SavedDrive$ <> Drive1.Drive) Then
- ClearListBox Form1.List1
- End If
- SavedDrive$ = Drive1.Drive
- T$ = ShowAllFiles.Caption
- Mid$(T$, Len(T$), 1) = UCase$(Drive1.Drive)
- ShowAllFiles.Caption = T$
- If ShowAllFiles.Value = False Then
- OldMousePointer = Screen.MousePointer
- Screen.MousePointer = 11
- Call FillList
- Screen.MousePointer = OldMousePointer
- End If
- End Sub
- Sub Drive1_GotFocus ()
- SavedDrive$ = Drive1.Drive
- End Sub
- Sub File1_Click ()
- Call ShowPicture((File1.Path), (File1.FileName))
- Call WallPaper
- Call PositionOutline
- If Not Loading Then
- Call DottedLine
- End If
- End Sub
- Sub File1_DblClick ()
- Call File1DClick
- End Sub
- Sub FileAbout_Click ()
- Form3.Show 1
- End Sub
- Sub FileExit_Click ()
- End Sub
- Sub Form_Load ()
- Loading% = True
- OldMousePointer = Screen.MousePointer
- Screen.MousePointer = 11
- Ver& = GetVersion()
- WinVer& = Ver& Mod &H10000
- WinVersion$ = Format$(WinVer& Mod &H100) + "." + Format$(WinVer& \ &H100)
- If WinVersion$ < "3.1" Then
- Screen.MousePointer = OldMousePointer
- MsgBox "This program requires Windows 3.1."
- End
- End If
- Load Form2
- Call GetBackgroundColor
- Form1.Visible = 1
- Form2.Visible = 1
- T% = DoEvents()
- If File1.ListCount > 0 Then File1.ListIndex = 0
- Form1.SetFocus
- ResizableChecked_Click
- Focus = -1
- Timer1.Interval = 10
- SavedDrive$ = Drive1.Drive
- Screen.MousePointer = OldMousePointer
- Loading% = False
- End Sub
- Sub Form_Resize ()
- 'Command1.Top = Scaleheight - Command1.height - 6
- 'Command1.Left = Scalewidth - Command1.width - 6
- If Form1.WindowState = 1 Then ' minimized
- Form2.Visible = False
- Form2.WindowState = 0
- Else
- Form2.Visible = True
- End If
- End Sub
- Sub Form_Unload (Cancel As Integer)
- End Sub
- Sub List1_Click ()
- Call GetNameAndDir((List1.List(List1.ListIndex)), FName$, DName$)
- Dir1.Path = DName$
- Call ShowPicture(DName$, FName$)
- Call WallPaper
- Call PositionOutline
- Call DottedLine
- End Sub
- Sub List1_DblClick ()
- Call List1DClick
- End Sub
- Sub ResizableChecked_Click ()
- 'Form2.Enabled = False
- If ResizableChecked.Value Then
- Form2.DestinationPic.Width = Form2.DestinationPic.Width + 2
- Form2.DestinationPic.Height = Form2.DestinationPic.Height + 2
- Form2.DestinationPic.Top = Form2.DestinationPic.Top - 1
- Form2.DestinationPic.Left = Form2.DestinationPic.Left - 1
- Form2.DestinationPic.Width = Form2.DestinationPic.Width - 2
- Form2.DestinationPic.Height = Form2.DestinationPic.Height - 2
- Form2.DestinationPic.Top = Form2.DestinationPic.Top + 1
- Form2.DestinationPic.Left = Form2.DestinationPic.Left + 1
- End If
- 'Form2.Enabled = True
- Call PositionOutline
- Call WallPaper
- Call DottedLine
- End Sub
- Sub SelectInFIleList (T$)
- For I = 1 To File1.ListCount
- If T$ = File1.List(I - 1) Then
- File1.ListIndex = I - 1
- Exit Sub
- End If
- Next I
- End Sub
- Sub ShowAllFiles_Click () 'Value As Integer
- OldMousePointer = Screen.MousePointer
- Screen.MousePointer = 11
- If ShowAllFiles.Value = 0 Then
- T$ = ""
- If List1.ListCount > 0 Then
- T$ = List1.List(List1.ListIndex)
- T$ = Left$(T$, InStr(T$, Chr$(9)) - 1)
- End If
- List1.Visible = False
- List1.Enabled = False
- File1.Visible = True
- File1.Enabled = True
- SelectInFIleList (T$)
- Dir1.ForeColor = RGB(0, 0, 0)
- Dir1.Enabled = True
- Command2.Visible = False
- T$ = ""
- If File1.ListCount > 0 Then
- T$ = File1.List(File1.ListIndex)
- End If
- For J = 1 To Dirs
- If DirName(J) = Dir1.Path Then
- T$ = T$ + Chr$(9) + Chr$(9) + Format$(J)
- Exit For
- End If
- Next J
- 'For I = 1 To List1.ListCount
- ' If T$ = List1.List(I - 1) Then
- ' List1.ListIndex = I - 1
- ' Exit For
- ' End If
- 'Next I
- TI% = FindItem(List1, T$)
- If TI% <> -1 Then List1.ListIndex = TI%
- File1.Visible = False
- File1.Enabled = False
- List1.Visible = True
- List1.Enabled = True
- Command2.Visible = True
- If List1.ListCount = 0 Then
- Call FillList
- Command2.Enabled = False
- End If
- Dir1.ForeColor = RGB(128, 128, 128)
- Dir1.Enabled = False
- End If
- Screen.MousePointer = OldMousePointer
- End Sub
- Sub TileChecked_Click () 'Value As Integer
- 'DoEvents
- Call DragPictureTo((Form2.DestinationPic.Width), (Form2.DestinationPic.Height), False)
- Call WallPaper
- Call PositionOutline
- Call DottedLine
- 'DoEvents
- End Sub
- Sub Timer1_Timer ()
- T = GetActiveWindow()
- If Focus Then
- If T <> Form1.hWnd And T <> Form2.hWnd And T <> Form3.hWnd Then
- Focus = 0
- End If
- Else
- If T = Form1.hWnd Or T = Form2.hWnd Or T = Form3.hWnd Then
- Call GetBackgroundColor
- If ShowAllFiles.Value Then
- Form1.Command2.Enabled = True
- Call List1_Click
- Else
- If File1.ListIndex <> -1 Then
- TT$ = File1.List(File1.ListIndex)
- End If
- File1.Refresh
- If File1.ListCount > 0 Then
- SelectInFIleList (TT$)
- If File1.ListIndex < 0 Then
- File1.ListIndex = 0
- Call File1_Click
- End If
- End If
- End If
- Focus = -1
- End If
- End If
- End Sub
-